###参数分别是：总记录数、当前页、总页数、跳转连接
#define paginate(totalRow, currentPage, totalPage, link)
	#if(totalPage < 2 || currentPage > totalPage)
		#return
	#end
	
	#setLocal(startPage = currentPage - 2)
	#if(startPage < 2)
		#setLocal(startPage = 2)
	#end
	#setLocal(endPage = currentPage + 2)
	#if(endPage > (totalPage-1))
		#setLocal(endPage = (totalPage-1))
	#end
	<div class="bg-white shadow-small radius margin-big-top padding">
		<span>共 #(totalRow) 条</span>
		<ul class="nav nav-page nav-divider">
			#if(currentPage==1)
			<li class="disabled"><a href="javascript:;">上一页</a></li>
			<li class="active"><a href="javascript:;">1</a></li>
			#else
			<li><a href="#(link)#(currentPage-1)#(append)">上一页</a></li>
			<li><a href="#(link)1#(append)">1</a></li>
			#end
			
			#if(startPage>2)
			<li><a href="javascript:;">...</a></li>
			#end
			
			#if(endPage>=startPage)
				#for(i : [startPage..endPage])
					#if(currentPage == i)
						<li class="active"><a href="javascript:;">#(i)</a></li>
					#else
						<li><a href="#(link)#(i)#(append)">#(i)</a></li>
					#end
				#end
			#end
			
			#if(endPage<totalPage-1)
			<li><a href="javascript:;">...</a></li>
			#end
			
			#if(currentPage==totalPage)
			<li class="active"><a href="javascript:;">#(totalPage)</a></li>
			<li class="disabled"><a href="javascript:;">下一页</a></li>
			#else
			<li><a href="#(link)#(totalPage)#(append)"  title="尾页">#(totalPage)</a></li>
			<li><a href="#(link)#(currentPage+1)#(append)">下一页</a></li>
			#end
		</ul>
	</div>	
#end